<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class OverdueMoreMail extends Mailable
{
    use Queueable, SerializesModels;

    private $path;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($path)
    {
        $this->path = $path;
    }

    /**
     * Description:
     * Author: Mmy
     * DateTime: 2019-03-17 22:02
     * @return OverdueMoreMail
     */
    public function build()
    {
        $today = date('Ymd');
        return $this->view('mail.overdue', ['data' => $today . '之前逾期数据，请查收'])->attach($this->path, [
            'as' => $today. '之前逾期数据.xlsx'
        ]);
    }
}
